data structures implementation sortings *1100

Please click on ads to support us..

Python Code:

numOfInitialErrors = int(input())
firstLineOfErrors = sorted([int(x) for x in input().split()])
secondLineOfErrors = sorted([int(x) for x in input().split()]) + [""]
thirdLineOfErrors = sorted([int(x) for x in input().split()]) + ["",""]

for error1, error2 in zip(firstLineOfErrors,secondLineOfErrors):
    if error1 != error2:
        print(error1)
        break

for error1, error2 in zip(secondLineOfErrors,thirdLineOfErrors):
    if error1 != error2:
        print(error1)
        break

C++ Code:

/*
                a           m     m      iiiiiiiiiiii tttttttttt
               a a         m  m m  m          i           t
             a    a       m    m    m         i           t
            aaaaaaaa     m           m        i           t
           a        a   m             m       i           t
          a          a m               m iiiiiiiiiiii     t                            */
 
 
#include<iostream>
#include<climits>
#include<bits/stdc++.h>
#include<string>
#include<math.h>
#include<algorithm>
#include <vector>
#define ll long long
#include<set>
#include<numeric>
#include<stack>
#include<map>
#include<iomanip>
#define pb push_back
#define mp make_pair
#define all(x)            (x).begin(),(x).end()
#define allr(x)    (x).begin(),(x).end(),greater<ll>()
#define nl  "\n"
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define repb(i,a,b)  for(ll i=a;i>=b;i--)
#define ull unsigned long long
//#include<unordered_set>
//#include<unordered_map>

using namespace std;

  
/*
 bool isPrime(ll n) {if (n == 2 || n == 3 || n == 5) {return true; } if (n % 2 == 0 || n % 3 == 0) {return false; } for (ll i=5; i*i<=n; i=i+6) {if (n%i == 0 || n%(i+2) == 0) {return false; } } return true; }

*/


/*
bool ispowoftwo(ll n){
    
    for(ll i=1;i<=47;i++){
        if(pow(2,i)==n){
            return true;
        }
        
    }
    
}
*/
/*
ll binsearch(ll arr[],ll n , ll xj){
	//cout<<"agya bc"<<endl;
	ll low = 0;
	ll high = n-1;
	ll mid;
ll ans ; 
	while(low<=high){
		 mid  = (high+low)/2;
		// cout<<"mid is "<<mid<<endl;
		if (arr[mid]<xj){
			low = mid+1;
		}
		else {
			ans = mid;
			high  = mid-1 ;
		}
	}
	//cout<<"abhi xj="<<xj<<"k liye apka answer = "<<mid+1<<endl;
	return ans +1;
}
*/

void online_judge(){
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
 
}


 void sol(){

ll n;
cin>>n;

unordered_map<ll,ll> m;

rep(i,0,n){
	ll a;
	cin>>a;
	m[a]++;
}


unordered_map<ll,ll> m2;
rep(i,0,n-1){
	ll a; cin>>a;
	m[a]--;
	m2[a]++;
	
}


for(auto val:m){
    if(val.second>0){
	cout<<val.first<<nl;
}
}

rep(i,0,n-2){
	ll a; cin>>a;

	m2[a]--;
}

for(auto val:m2){
	  if(val.second>0){
	cout<<val.first<<nl;
}
}
return;

}

 
int main(){

//online_judge();
   sol(); 


}	


Comments

Submit
0 Comments
More Questions

1566B - MIN-MEX Cut
678C - Joty and Chocolate
1352E - Special Elements
1520E - Arranging The Sheep
1157E - Minimum Array
1661D - Progressions Covering
262A - Roma and Lucky Numbers
1634B - Fortune Telling
1358A - Park Lighting
253C - Text Editor
365B - The Fibonacci Segment
75A - Life Without Zeros
1519A - Red and Blue Beans
466A - Cheap Travel
659E - New Reform
1385B - Restore the Permutation by Merger
706A - Beru-taxi
686A - Free Ice Cream
1358D - The Best Vacation
1620B - Triangles on a Rectangle
999C - Alphabetic Removals
1634C - OKEA
1368C - Even Picture
1505F - Math
1473A - Replacing Elements
959A - Mahmoud and Ehab and the even-odd game
78B - Easter Eggs
1455B - Jumps
1225C - p-binary
1525D - Armchairs